package com.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.lang.reflect.InvocationTargetException;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;


/**
 * 在线考试表
 * 数据库通用操作实体类（普通增删改查）
 *
 * @author
 * @email
 * @date 2022-03-18 10:34:29
 */
@TableName("exampaper")
public class ExampaperEntity<T> implements Serializable {
    private static final long serialVersionUID = 1L;


    public ExampaperEntity() {

    }

    public ExampaperEntity(T t) {
        try {
            BeanUtils.copyProperties(this, t);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    /**
     * 主键id
     */
    @TableId
    private Long id;

    /**
     * 考试分类
     */
    @TableField("category_id")
    private Long categoryId;

    /**
     * 在线考试名称
     */

    private String name;

    /**
     * 考试时长(分钟)
     */

    private Integer duration;

    /**
     * 考试状态：0-未开始，1-报名中，2-报名结束，3-考试中，4-已结束
     */

    private Integer status;

    /**
     * 考试简介
     */
    private String brief;

    /**
     * 封面
     */
    @TableField("cover_image")
    private String coverImage;


    /**
     * 考试开始时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @TableField("start_time")
    private LocalDateTime startTime;

    /**
     * 考试结束时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @TableField("end_time")
    private LocalDateTime endTime;


    /**
     * 报名开始时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @TableField("enrollment_start")
    private LocalDateTime enrollmentStart;

    /**
     * 报名结束时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @TableField("enrollment_end")
    private LocalDateTime enrollmentEnd;

    /**
     * 创建时间
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    @TableField("create_time")
    private LocalDateTime createTime;

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 设置：在线考试名称
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取：在线考试名称
     */
    public String getName() {
        return name;
    }

    /**
     * 设置：考试时长(分钟)
     */
    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    /**
     * 获取：考试时长(分钟)
     */
    public Integer getDuration() {
        return duration;
    }

    /**
     * 设置：在线考试状态
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 获取：在线考试状态
     */
    public Integer getStatus() {
        return status;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getBrief() {
        return brief;
    }

    public void setBrief(String brief) {
        this.brief = brief;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public LocalDateTime getEnrollmentStart() {
        return enrollmentStart;
    }

    public void setEnrollmentStart(LocalDateTime enrollmentStart) {
        this.enrollmentStart = enrollmentStart;
    }

    public LocalDateTime getEnrollmentEnd() {
        return enrollmentEnd;
    }

    public void setEnrollmentEnd(LocalDateTime enrollmentEnd) {
        this.enrollmentEnd = enrollmentEnd;
    }
}
